package cc.jt.rl;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.stream.Collectors;


public class ScriptUtil {

  public static String getScript(String path) throws IOException {
    InputStream stream = ScriptUtil.class.getClassLoader().getResourceAsStream(path);
    try (BufferedReader reader = new BufferedReader(new InputStreamReader(stream))) {
      return reader.lines().collect(Collectors.joining(System.lineSeparator()));
    }
  }
}
